<template>
	<div style="height: 80vh;border: 1px solid blue;">
		<h2>修改密码</h2>
		<hr>
		<p>原密码：<input type="text" v-model="data.gopwd" /></p>
		<p>新密码：<input type="text" v-model="data.dopwd" /></p>
		<p>确认密码：<input type="text" v-model="data.dopwd2" /></p>
		<hr>
		<button @click="updated()">修改密码</button>
	</div>
</template>

<script setup>
import { ref, reactive, onMounted, computed } from "vue"
import { $get, $postx, $postj, $postf } from '../../ajax/index.js'
import alert from '../../utils/doalert.js'
const data = reactive({
	gopwd: "",
	dopwd: "",
	dopwd2: ""
})
function updated() {
	console.log("更新密码")
	if (data.dopwd != data.dopwd2) {
		alert("新密码不一致")
		return
	}
	let a = { oldPwd: data.gopwd, newPwd: data.dopwd }
	$postx("/api/user/updatePwd", a).then((reap) => {
		alert(reap.data.msg)
	})

}


</script>

<style></style>
